﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace park.ModelCode
{
    public partial class DictionaryAdd : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {

            #region 正式代码
            string strName = this.txbName.Text;
            string strContentItem = this.txbContentItem.Text;

            cn.linkit.epark.ServiceList sl = new cn.linkit.epark.ServiceList();
            bool flag = sl.AddDictionary(strName, strContentItem);

            string msg = flag ? "数据保存成功！" : "数据保存失败，请重试...";

            Page.ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "<script>alert('" + msg + "');</script>");
            #endregion

            #region 测试代码
            //string strName = this.txbName.Text;
            //string strContentItem = this.txbContentItem.Text;
            //bool flag =true;
            //string msg = flag ? "数据保存成功！" : "数据保存失败，请重试...";
            //Page.ClientScript.RegisterStartupScript(GetType(), Guid.NewGuid().ToString(), "<script>alert('" + msg + "');</script>");
            #endregion
        }
    }
}